package com.zufe.khw;

import java.util.Scanner;

public class Test2 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        System.out.println("请输入一个数");
        String str = sc.nextLine();
        if(!str.matches("[1-9]\\d{0,9}")){
            System.out.println("输入格式不正确，请重新输入！");
        }else{
            int sum = 0;
            for(int i = 0; i < str.length(); i++){
                sum = sum * 10 + str.charAt(i) - '0';
            }
            System.out.println("输入的数字：" + sum);
            System.out.println(sum + 1);
        }
    }
}
